<?php
namespace AuctionCore\CarResource;


/**
* 帐户组 测试类
* @author       Eric Lee
*/
class CarTest extends \PHPUnit_Framework_TestCase {
    public $inside = array(
                            '1'=>'左前门内饰',
                            '2'=>'右前门内饰',
                            '3'=>'左后门内饰',
                            '4'=>'右后门内饰',
                            '5'=>'手套箱',
                            '6'=>'车棚顶',
                            '7'=>'车内地胶',
                            '8'=>'排挡手柄',
                            '9'=>'扶手箱',
                            '10'=>'方向盘',
                            '11'=>'左前门扶手',
                            '12'=>'右前门扶手',
                            '13'=>'左后门扶手',
                            '14'=>'右后门扶手',
                            '15'=>'中控台',
                            '16'=>'主驾座椅',
                            '17'=>'副驾座椅',
                            '18'=>'后排座椅',
                            '19'=>'仪表',
                            '20'=>'后备箱',
                            '21'=>'内饰损伤其它',
    );
    public $outside = array(
                            '22'=>'左前翼子板',
                            '23'=>'引擎盖',
                            '24'=>'右前翼子板',
                            '25'=>'左前门',
                            '26'=>'左后门',
                            '27'=>'左后翼子板',
                            '28'=>'行李箱盖',
                            '29'=>'右后翼子板',
                            '30'=>'右后门',
                            '31'=>'右前门',
                            '32'=>'车顶',
                            '33'=>'前保险杠',
                            '34'=>'后保险杠',
                            '35'=>'进气格栅',
                            '36'=>'天线',
                            '37'=>'左前组合灯',
                            '38'=>'右前组合灯',
                            '39'=>'右前雾灯',
                            '40'=>'左前雾灯',
                            '41'=>'右侧边灯',
                            '42'=>'左侧边灯',
                            '43'=>'右后组合灯',
                            '44'=>'左后组合灯',
                            '45'=>'左前轮胎',
                            '46'=>'左后轮胎',
                            '47'=>'右前轮胎',
                            '48'=>'右后轮胎',
                            '49'=>'备胎',
                            '50'=>'左前轮毂',
                            '51'=>'左后轮毂',
                            '52'=>'右前轮毂',
                            '53'=>'右后轮毂',
                            '54'=>'左反光镜',
                            '55'=>'右反光镜',
                            '56'=>'左前门玻璃',
                            '57'=>'左后门玻璃',
                            '58'=>'右前门玻璃',
                            '59'=>'右后门玻璃',
                            '60'=>'前挡风玻璃',
                            '61'=>'后挡风玻璃',
                            '62'=>'左侧三角玻璃',
                            '63'=>'右侧三角玻璃',
                            '64'=>'左前门拉手（锁）',
                            '65'=>'左后门拉手（锁）',
                            '66'=>'右前门拉手（锁）',
                            '67'=>'右后门拉手（锁)',
                            '68'=>'后备箱（锁）',
                            '69'=>'引擎盖',
                            '70'=>'外观其它位置',
    );
    public $framework = array(
                            '71'=>'水箱支架',
                            '72'=>'左前照灯框架',
                            '73'=>'右前照灯框架',
                            '74'=>'左前翼子板内衬',
                            '75'=>'右前翼子板内衬',
                            '76'=>'右后尾灯框架',
                            '77'=>'左后尾灯框架',
                            '78'=>'左A柱',
                            '79'=>'右A柱',
                            '80'=>'左B柱',
                            '81'=>'右B柱',
                            '82'=>'左C柱',
                            '83'=>'右C柱',
                            '84'=>'左前纵梁',
                            '85'=>'右前纵梁',
                            '86'=>'左后纵梁',
                            '87'=>'右后纵梁',
                            '88'=>'左前减震器座',
                            '89'=>'左后减震器座',
                            '90'=>'右前减震器座',
                            '91'=>'右后减震器座',
                            '92'=>'防火墙',
                            '93'=>'行李箱底板',
                            '94' => '骨架损伤其它位置（结构件）',
                            '95' => '骨架损伤其它位置（加强件）',
                            '96' => '后围板'
    );

	public function testReport(){
           $car = new Car(1);
           $ret = $car->report();
           dump($ret,true,null,false);
           self::assertTrue($ret?true:false);
    }

	public  function testCreateCar(){

            $data = array();
            $data['car_id'] ='';
            $data['car_no'] = gen_car_no();
            //车主
            $data['seller_name'] ='李国华';
            $data['certificate_type'] ='1';
            $data['certificate_number'] ='130481197908062879';
            $data['phone'] ='15921306031';
            $data['province'] ='130000';
            $data['city'] ='130400';
            $data['area'] ='130481';
            $data['address'] ='上团城乡大南庄村218号';
            $data['is_equal'] ='1';

            //手续
            $data['is_travel_license'] ='1';
            $data['travel_license_pic'] ='Uploads/Pictures/2015-08-22/travel_card_110132hwds809.jpg';
            $data['travel_license_pic2'] ='Uploads/Pictures/2015-08-22/travel_card_1127011eyo626.jpg';
            $data['travel_license_pic3'] ='Uploads/Pictures/2015-08-22/travel_card_11363481fo444.jpg';
            $data['vin'] ='LSVNN2180D2013488';
            $data['plate_prefix'] ='1';
            $data['plate_suffix'] ='ASB945';
            $data['car_type'] ='2';
            $data['car_use_properties'] ='1';
            $data['brand_model'] ='BJ2020S';
            $data['engine_no'] ='246764k';
            $data['verify_expiry'] ='2016-12-30';

            $data['is_reg_cert'] ='1';//0见到行驶证 1未见行驶证
            $data['reg_cert_pic'] ='Uploads/Pictures/2015-08-22/car_light_110139k3jn909.jpg';
            $data['reg_cert_pic2'] ='Uploads/Pictures/2015-08-22/car_light_110139k3jn909.jpg';
            $data['reg_cert_pic3'] ='Uploads/Pictures/2015-08-22/car_light_110139k3jn909.jpg';

            $data['car_color'] ='1';
            $data['is_imported'] ='1';
            $data['fuel_type'] ='1';
            $data['car_cc'] ='1595 ml';
            $data['tyre_type'] ='205/55 R16';
            $data['carrying_num'] ='5';
            $data['get_method'] ='1';
            $data['reg_city'] ='130400';
            $data['first_reg_date'] ='2013-10-10';
            $data['ex_factory_date'] ='2012-6-6';
            $data['transfer_times'] ='1';
            $data['cur_use_type'] ='1';
            $data['remark_in_reg_cert'] ='remark_in_reg_cert';
            $data['com_insure_expiry'] ='2016-12-30';
            $data['com_insure_expiry_remark'] ='2';//1,2 详见car_config.php
            $data['com_insure_city'] ='130400';
            $data['com_insure_city_remark'] ='2';
            $data['car_tax_expiry'] ='2016-12-30';
            $data['car_tax_expiry_remark'] ='1';
            $data['invoice'] ='120990.00';
            $data['invoice_remark'] ='2';
            $data['transfer_ticket'] ='1';
            $data['commodity_inspection_list'] ='1';
            $data['import_customs_list'] ='2';
            $data['pur_tax_cert'] ='1';
            $data['bak_key'] ='1';

            //车辆基本信息
            $data['brand_id'] ='10281';//品牌
            $data['series_id'] ='2704';//车系
            $data['model_id'] ='8406';//车型
            $data['gearbox'] ='2';//自动
            $data['pointer_mileage'] ='2';//万公里
            $data['drive_method'] ='1';
            $data['nameplate'] ='1';
            $data['maintain_man'] ='1';
            $data['appear_change'] ='1';
            $data['ill_deduc_point'] ='1';
            $data['forfeit'] ='200';
            $data['emission'] ='3';
            //基本照片
            $data['p_left_front45']         ='http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
            $data['p_right_after45']        ='http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
            $data['p_appearance_front_row'] ='http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
            $data['p_appearance_back_row']  ='http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
            $data['p_appearance_control']   ='http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
            $data['p_instrument_panel']     ='http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
            $data['p_engine_room_l']        ='http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
            $data['p_engine_room_r']        ='http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
            $data['p_engine_room']          ='http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
            $data['p_trunk']                ='http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
            $data['p_key']                  ='http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
            $data['p_car_top']              ='http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
            $data['p_vin']                  ='http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
            $data['p_travel_license']       ='http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
            $data['p_nameplate']            ='http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
            //配置
            $data['abs'] ='2';
            $data['air_sac'] ='1';
            $data['turn_helper'] ='2';
            $data['ele_car_window'] ='1';
            $data['area_window'] ='1';
            $data['air_cond'] ='4';
            $data['seat_texture'] ='2';
            $data['seat_adjust'] ='2';
            $data['seat_func'] ='4';
            $data['audio'] ='6';
            $data['dvd'] ='4';
            $data['navi'] ='1';
            $data['fixed_cruise'] ='1';
            $data['reverse_video'] ='1';
            $data['reverse_radar'] ='1';
            $data['tire_hub_texture'] ='2';
            $data['mirror'] ='1';
            $data['inte_key'] ='2';
            //修复历史
            $data['wing_board'] ='1';
            $data['l_f_door'] ='1';
            $data['l_b_door'] ='1';
            $data['l_b_wing_board'] ='1';
            $data['trunk_cover'] ='1';
            $data['r_b_wing_board'] ='1';
            $data['r_b_door'] ='1';
            $data['r_f_door'] ='1';
            $data['r_f_wing_board'] ='1';
            $data['engine_cover'] ='1';
            $data['car_roof'] ='1';
            $data['l_a_bar'] ='1';
            $data['l_b_bar'] ='1';
            $data['l_c_bar'] ='1';
            $data['r_c_bar'] ='1';
            $data['r_b_bar'] ='1';
            $data['r_a_bar'] ='1';
            $data['cover_inner_edge'] ='1';


            //---内饰损伤
            $arr1  = array();
            $i=0;
            foreach($this->inside as $k=>$v){//1内饰(共20+1项)，2外观(共48+1项)，3骨架(共25+1)
                    $arr1[$i]['position'] = $k;
                    $arr1[$i]['visible_type'] = 1;//1内饰，2外观，3骨架
                    $arr1[$i]['dm_degree'] = rand(1,4);//1 无损伤 2轻微损伤 3一般损伤 4重要损伤
                    $arr1[$i]['cus_pos_name'] = 'cus_pos_namexxx_'.$i;
                    $arr1[$i]['describe'] = 'describexxx_'.$i;
                    $arr1[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr1[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr1[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr1[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr1[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr1[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr1[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr1[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr1[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr1[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $i++;
            }
            //---外观损伤
            $arr2  = array();
            $i=0;
            foreach($this->outside as $k=>$v){//1内饰(共20+1项)，2外观(共48+1项)，3骨架(共25+1)
                    $arr2[$i]['position'] = $k;
                    $arr2[$i]['visible_type'] = 2;//1内饰，2外观，3骨架
                    $arr2[$i]['dm_degree'] = rand(1,4);//1 无损伤 2轻微损伤 3一般损伤 4重要损伤
                    $arr2[$i]['cus_pos_name'] = 'cus_pos_namexxx_'.$i;
                    $arr2[$i]['describe'] = 'describexxx_'.$i;
                    $arr2[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr2[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr2[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr2[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr2[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr2[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr2[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr2[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr2[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr2[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $i++;
            }
            //---骨架损伤
            $arr3  = array();
            $i=0;
            foreach($this->framework as $k=>$v){//1内饰(共20+1项)，2外观(共48+1项)，3骨架(共25+1)
                    $arr3[$i]['position'] = $k;
                    $arr3[$i]['visible_type'] = 3;//1内饰，2外观，3骨架
                    $arr3[$i]['dm_degree'] = rand(1,4);//1 无损伤 2轻微损伤 3一般损伤 4重要损伤
                    $arr3[$i]['cus_pos_name'] = 'cus_pos_namexxx_'.$i;
                    $arr3[$i]['describe'] = 'describexxx_'.$i;
                    $arr3[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr3[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr3[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr3[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr3[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr3[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr3[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr3[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr3[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $arr3[$i]['urls'][] = 'http://clcw.oss-cn-beijing.aliyuncs.com/car_base/left_front45/left_front45_2120ac8f-56d4-4f57-a8f4-6ae6203d361d.JPG';
                    $i++;
            }

            $data['damage_info'] = array_merge($arr1,$arr2,$arr3);

            //工况---
            $data['starter'] ='1,3';
            $data['steering_engine'] ='2,4';
            $data['engine'] ='1,2';
            $data['engine_box'] ='2,4';
            $data['ele_sys'] ='3,5,6';
            $data['tool_state'] ='1,2';
            $data['bak_tire'] ='1';
            $data['other_info'] = '补充说明';

            //车辆历史状况
            $data['composite_state'] ='2';
            $data['accident_level'] ='1';
            $data['history_state'] ='2';

            $ret = Car::create($data);

            self::assertGreaterThan(0,$ret);
            //self::assertEquals(1,$ret);
            //self::assertTrue($ret);

	}

    public function testEditCar(){

        $data = array();
        $data['car_id'] ='1';
        //车主
        $data['seller_name'] ='李国华2';
        $data['certificate_type'] ='2';
        $data['certificate_number'] ='130481790806287';
        $data['phone'] ='15921306127';
        $data['province'] ='2';
        $data['city'] ='110100';
        $data['area'] ='110114';
        $data['address'] ='回龙观沙河，小沙河村';
        $data['is_equal'] ='3';

        //手续
        $data['is_travel_license'] ='0';
        $data['travel_license_pic'] ='';
        $data['travel_license_pic2'] ='';
        $data['travel_license_pic3'] ='';
        $data['vin'] ='LSVNN2180D2013499';
        $data['plate_prefix'] ='2';
        $data['plate_suffix'] ='ASB438';
        $data['car_type'] ='1';
        $data['car_use_properties'] ='3';
        $data['brand_model'] ='BJ2110A';
        $data['engine_no'] ='246654k';
        $data['verify_expiry'] ='2017-12-30';

        $data['is_reg_cert'] ='0';//0见到行驶证 1未见行驶证
        $data['reg_cert_pic'] ='';
        $data['reg_cert_pic2'] ='';
        $data['reg_cert_pic3'] ='';

        $data['car_color'] ='5';
        $data['is_imported'] ='3';
        $data['fuel_type'] ='3';
        $data['car_cc'] ='0 ml';
        $data['tyre_type'] ='205/55 R15';
        $data['carrying_num'] ='7';
        $data['get_method'] ='3';
        $data['reg_city'] ='110108';
        $data['first_reg_date'] ='2014-8-8';
        $data['ex_factory_date'] ='2013-8-8';
        $data['transfer_times'] ='2';
        $data['cur_use_type'] ='2';
        $data['remark_in_reg_cert'] ='登记证上的备注信息（一般没有吧）';
        $data['com_insure_expiry'] ='2018-12-30';
        $data['com_insure_expiry_remark'] ='1';//1,2 详见car_config.php
        $data['com_insure_city'] ='110108';//海淀
        $data['com_insure_city_remark'] ='1';
        $data['car_tax_expiry'] ='2019-12-30';
        $data['car_tax_expiry_remark'] ='0';//1未见，0已见
        $data['invoice'] ='200990.00';
        $data['invoice_remark'] ='1';
        $data['transfer_ticket'] ='2';
        $data['commodity_inspection_list'] ='2';
        $data['import_customs_list'] ='1';
        $data['pur_tax_cert'] ='2';
        $data['bak_key'] ='2';

        //车辆基本信息
        $data['brand_id'] ='10078';//品牌 北京现代
        $data['series_id'] ='1043';//车系
        $data['model_id'] ='30683';//车型
        $data['gearbox'] ='1';//手动
        $data['pointer_mileage'] ='5';//万公里
        $data['drive_method'] ='2';
        $data['nameplate'] ='2';
        $data['maintain_man'] ='2';
        $data['appear_change'] ='2';
        $data['ill_deduc_point'] ='10';
        $data['forfeit'] ='1000';
        $data['emission'] ='4';
        //基本照片
        $data['p_left_front45'] ='left_front45_110137d1b7229.jpg';
        $data['p_right_after45'] ='right_after45_110140dw3o635.jpg';
        $data['p_appearance_front_row'] ='appearance_front_row_110141ldyj233.jpg';
        $data['p_appearance_back_row'] ='appearance_back_row_1101342plz515.jpg';
        $data['p_appearance_control'] ='appearance_control_11014278se826.jpg';
        $data['p_instrument_panel'] ='instrument_panel_110133a23m509.jpg';
        $data['p_engine_room_l'] ='engine_room_165236ekoh190.jpg';
        $data['p_engine_room_r'] ='engine_room_203506hyfd211.jpg';
        $data['p_engine_room'] ='engine_room_154828hfg5164.jpg';
        $data['p_trunk'] ='p_trunk_123712gl4w379.jpg';
        $data['p_key'] ='key_110141e4ek372.jpg';
        $data['p_car_top'] ='car_roof_120652ezp101.jpg';
        $data['p_vin'] ='plate_number_p_112720d2rd941.jpg';
        $data['p_travel_license'] ='travel_card_11393232qf158.jpg';
        $data['p_nameplate'] ='nameplate_160801hxe9551.jpg';
        //配置
        $data['abs'] ='1';
        $data['air_sac'] ='2';
        $data['turn_helper'] ='1';
        $data['ele_car_window'] ='2';
        $data['area_window'] ='2';
        $data['air_cond'] ='2';
        $data['seat_texture'] ='1';
        $data['seat_adjust'] ='1';
        $data['seat_func'] ='2';
        $data['audio'] ='3';
        $data['dvd'] ='1';
        $data['navi'] ='2';
        $data['fixed_cruise'] ='2';
        $data['reverse_video'] ='2';
        $data['reverse_radar'] ='2';
        $data['tire_hub_texture'] ='1';
        $data['mirror'] ='1';
        $data['inte_key'] ='2';
        //修复历史
        $data['wing_board'] ='2';
        $data['l_f_door'] ='2';
        $data['l_b_door'] ='3';
        $data['l_b_wing_board'] ='2';
        $data['trunk_cover'] ='2';
        $data['r_b_wing_board'] ='3';
        $data['r_b_door'] ='2';
        $data['r_f_door'] ='2';
        $data['r_f_wing_board'] ='3';
        $data['engine_cover'] ='2';
        $data['car_roof'] ='2';
        $data['l_a_bar'] ='3';
        $data['l_b_bar'] ='2';
        $data['l_c_bar'] ='2';
        $data['r_c_bar'] ='3';
        $data['r_b_bar'] ='2';
        $data['r_a_bar'] ='2';
        $data['cover_inner_edge'] ='3';

        //---损伤
        $arr  = array();
        $i=0;
        foreach(C('VISIBLE_DAMAGE_POSITION') as $k=>$v){
                $arr[$i]['position'] = $k;
                $arr[$i]['visible_type'] = '2';
                $arr[$i]['dm_degree'] = '2';
                $arr[$i]['cus_pos_name'] = 'cus_pos_namexxx_'.$i;
                $arr[$i]['describe'] = 'describexxx_'.$i;
                $arr[$i]['urls'][] = '11274785yu121.jpg';
                $arr[$i]['urls'][] = '11274785yu122.jpg';
                $arr[$i]['urls'][] = '11274785yu123.jpg';
                $arr[$i]['urls'][] = '11274785yu124.jpg';
                $arr[$i]['urls'][] = '11274785yu125.jpg';
                $arr[$i]['urls'][] = '11274785yu126.jpg';
                $arr[$i]['urls'][] = '11274785yu127.jpg';
                $arr[$i]['urls'][] = '11274785yu128.jpg';
                $arr[$i]['urls'][] = '11274785yu129.jpg';
                $arr[$i]['urls'][] = '11274785yu130.jpg';
                $i++;
        }

        $data['damage_info'] = $arr;

        //工况---
        $data['starter'] ='3';
        $data['steering_engine'] ='4';
        $data['engine'] ='5';
        $data['engine_box'] ='6';
        $data['ele_sys'] ='7';
        $data['tool_state'] ='3';
        $data['bak_tire'] ='2';
        $data['other_info'] = '补充说明11111'.$this->microtime_float();

        //车辆历史状况
        $data['composite_state'] ='5';
        $data['accident_level'] ='4';
        $data['history_state'] ='';

		 $ret = Car::edit_car($data);
		 $this->assertTrue($ret);
         //self::assertGreaterThan(false,$ret);

	}
    public static  function testCreateOrder(){

               $au_info = array();
               $au_info['car_id'] = '1';
               $au_info['emp_id'] = '1';
               $au_info['scene_id'] = '1';
               $au_info['bid_start_time'] = '2015-12-10 12:12:12';
               $au_info['bidding_start_time'] = '2015-12-10 13:13:13';
               $au_info['bidding_end_time'] = '2015-12-10 14:14:14';
               $au_info['success_price'] = '100,990.00';
               $au_info['status'] = '1';
               $au_info['fail_type'] = '1';
               $au_info['commision'] = '1000';
               $au_info['transfer_fee'] = '1000';
               $au_info['trade_time'] = '2015-12-10 10:22:30';
               $au_info['pay_type'] = '1';
               $au_info['deliver_type'] = '1';
               $au_info['remark_fail'] = '失败说明';
               $au_info['remark_reject'] = '驳回说明';
               $au_info['bid_start_price'] = '80000.00';
               $au_info['bid_best_price'] = '90000.00';
               $au_info['bidding_best_price'] = '100,990.00';
               $au_info['dealer_confirm_status'] = '0';
               $au_info['is_self_confirm'] = '1';
               $au_info['last_time'] = date('Y-m-d H:i:s');
               $au_info['create_time'] = date('Y-m-d H:i:s');
               $car = new Car(1);
               try{
                   $ret = $car->create_order($au_info);
               }catch(\Exception $e){
                   $e->getMessage();
                   $ret = false;
               }

               self::assertTrue($ret?true:false);
       }
    function microtime_float()
    {
        list($usec, $sec) = explode(" ", microtime());
        return ((float)$usec + (float)$sec);
    }

}

?>